package com.tentative.competition.web.controller.schedule.client;

import com.tentative.competition.common.annotation.Anonymous;
import com.tentative.competition.common.core.controller.BaseController;
import com.tentative.competition.common.core.domain.AjaxResult;
import com.tentative.competition.common.core.result.ApiResult;
import com.tentative.competition.common.model.schedule.param.RegisterParam;
import com.tentative.competition.schedule.service.ScheduleRegisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @auther: Smile Huang
 * @date: 2023/6/21 23:33
 * @desc:
 * @version: 2.0
 */
@Api(tags = "client-注册接口")
@RestController
@RequestMapping("/client")
public class ClientRegisterController  extends BaseController {

    @Autowired
    private ScheduleRegisterService registerService;
    /**
     * 客户端注册
     * @return
     */
    @Anonymous
    @ApiOperation("注册接口")
    @PostMapping("/register")
    public AjaxResult register(@RequestBody RegisterParam param) {
        registerService.register(param);
        return AjaxResult.success();
    }
    /**
     * 查询注册信息
     * @return
     */
    @Anonymous
    @ApiOperation("查询注册信息")
    @GetMapping("/getRegisterInfo")
    public ApiResult getRegisterInfo(Long id) {
        return ApiResult.ok(registerService.getRegisterInfo(id));
    }


}
